def is_correct_brackets(text):
    while'()' in text or '[]' in text or '<>' in text:
        text = text.replace( '()' , '')
        text = text.replace( '[]' , '')
        text = text.replace( '{}' , '')
        text = text.replace( '<>' , '')

        return not text


s = 'Y'

while s != 'n' :
    inputString = input(" введите последовательность скобок: ")
    print(is_correct_brackets(inputString.strip()))
    print(' Continue? , Enter n or y')
    s = input()
print(' end ')
        
    
